﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="EmailSender.ascx.cs" Inherits="controls_admin_EmailSender" %>
<!-- table -->
<script type="text/javascript">
    $(document).ready(function () {
        $(".del").click(function () {
            var ids = "";
            $(".last input[type=checkbox].item").each(function () {
                var checked = $(this).attr("checked");
                if (checked) {
                    ids = ids + $(this).parent().parent().attr("id") + ";";
                }
            });
            if (ids == "") {
                return false;
            }
            else {
                $("#<%=hdfID.ClientID %>").val(ids);
                return confirm("Đồng ý xóa.");
            }
        });
    });        
</script>
<asp:HiddenField runat="server" ID="hdfID" Value="" />
<div class="box">
    <!-- box / title -->
    <div class="title">
        <h5>
            Cấu hình Email</h5>
    </div>
    <div id="divMessage" runat="server">
    </div>
    <div class="first-action">
        <div class="button">
            <a href="default.aspx?control=EmailSenderAdd">
                <input value="Thêm mới" type="button" /></a>
        </div>
    </div>
    <!-- end box / title -->
    <div class="table">
        <table>
            <thead>
                <tr>
                    <th>
                        Máy chủ mail
                    </th>
                    <th class="smaller">
                        Cổng
                    </th>
                    <th>
                        Tài khoản
                    </th>
                    <th>
                        Mật khẩu
                    </th>
                    <th>
                        Ngày tạo
                    </th>
                    <th>
                        Người tạo
                    </th>
                    <th class="small">
                        Duyệt
                    </th>
                    <th class="small">
                        Sửa
                    </th>
                    <th class="selected last">
                        <input type="checkbox" class="checkall" />
                    </th>
                </tr>
            </thead>
            <tbody>
                <asp:Repeater ID="rptContact" runat="server" OnItemCommand="rptContact_ItemCommand">
                    <ItemTemplate>
                        <tr id='<%#Eval("EMAIL_ID")%>'>
                            <td class="left">
                                <%#Eval("HOST_NAME")%>
                            </td>
                            <td class="right">
                                <%#Eval("PORT")%>
                            </td>
                            <td class="left">
                                <%#Eval("USER_NAME")%>
                            </td>
                            <td>
                                <%#Eval("PASS_WORD")%>
                            </td>
                            <td>
                                <%#Eval("CREATED_DATE")%>
                            </td>
                            <td>
                                <%#Eval("CREATED_BY")%>
                            </td>
                            <td>
                                <asp:CheckBox runat="server" ID="cboRead" Checked='<%#Eval("IS_ACTIVED") %>' Enabled='<%#!Convert.ToBoolean(Eval("IS_ACTIVED"))%>'
                                    AutoPostBack="true" />
                                <asp:HiddenField runat="server" ID="hdf" Value='<%#Eval("EMAIL_ID") %>' />
                            </td>
                            <td>
                                <a href="default.aspx?control=emailsenderedit&id=<%#Eval("EMAIL_ID") %>" class="edit"
                                    title="Chỉnh sửa">&nbsp;&nbsp;&nbsp;</a>
                            </td>
                            <td align="center" class="last" style="vertical-align: middle">
                                <input type="checkbox" class="item" />
                            </td>
                        </tr>
                    </ItemTemplate>
                </asp:Repeater>
            </tbody>
        </table>
        <div class="action">
            <asp:DropDownList ID="ddlAction" runat="server" OnSelectedIndexChanged="ddlAction_SelectedIndexChanged"
                AutoPostBack="true" CssClass="selectwidth">
                <asp:ListItem Value="0" class="folder-open" Text="---Chọn hành động---"></asp:ListItem>
                <asp:ListItem Value="1" class="locked" Text="Di chuyển tới thùng rác"></asp:ListItem>
                <asp:ListItem Value="2" class="unlocked" Text="Xóa vĩnh viễn"></asp:ListItem>
            </asp:DropDownList>
            <div class="button">
                <a href="default.aspx?control=EmailSenderAdd">
                    <input value="Thêm mới" type="button" /></a>
            </div>
        </div>
    </div>
</div>
<!-- end table -->
